<?php
namespace Blind\Controller;
use Think\Controller;
class UserController extends Controller {


	//通过手机号判断用户是否存在
	public function index()
	{
		$phone = I('post.phone');
        $data = D('user') -> getPhone($phone);
        if ($data) {
            return $this->ajaxReturn(1);
        } else {
            return $this->ajaxReturn(0);
        }
	}

	//跳转登录页面
	public function login()
	{
		$this -> display();
	}



	public function uploads()
	{
	    $upload = new \Think\Upload();// 实例化上传类
	    $upload->maxSize   =     3145728 ;// 设置附件上传大小
	    $upload->exts      =     array('jpg', 'gif', 'png', 'jpeg');// 设置附件上传类型
	    $upload->rootPath  =     './Uploads/'; // 设置附件上传根目录
	    $upload->savePath  =     ''; // 设置附件上传（子）目录
	    // 上传文件 

	    $info   =   $upload->upload();
	    //获取上传图片的路径
	    if($info)
	    {
	    	foreach ($info as $key => $value) {
	    		$goods_img = $value['savepath'] . $value['savename'];
	    	}
	    }
	    return $goods_img;
	}


	//跳转填写用户详情页面
	public function setInfo()
	{
		$this -> display();
	}


	//用户填写个人信息
	public function userInfo()
	{
		//获取所有传过来的值
		$data = I('post');

	}

	//跳转填写匹配对象页面
	public function blindInfo()
	{
		$this -> display();
	}

	//获取用户匹配对象信息
	public function blindInfo()
	{
		$getinfo = D('goods') -> getinfo();

		$this -> assign('getinfo', $getinfo);

		$this -> display();
	
	}


    
}